package com.xiaoliu.servlet;

import com.xiaoliu.util.Constant;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ShoppingCardLoginServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String shoppingCardName = req.getParameter("shoppingCardName");
        String shoppingCardPassword = req.getParameter("shoppingCardPassword");

        if (shoppingCardName.equals("小刘") && shoppingCardPassword.equals("123456")) {

            resp.sendRedirect("/ShoppingCart.html");
        } else {
            resp.sendRedirect("/ShoppingCartLogin.jsp");
        }



    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
